import Vue from 'vue'
import Vuex from 'vuex'
import user from './user'
import course from './course'
import permission from './permission'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    user,
    course,
    permission
  },
  getters: {
    token: state => state.user.token,
    userInfo: state => state.user.userInfo,
    courseInfo: state => state.course.courseInfo,
    asyncRoutes: state => state.permission.asyncRoutes
  },
})
